package cn.shop.dys.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import cn.shop.dys.R;
import cn.shop.lib_common.CommonUtil;

/**
 * Created by sen on 2016/4/23 0023.
 */
public class EmptyActivity extends AppCompatActivity {
    private Runnable task = new Runnable() {
        @Override
        public void run() {
            openActivity(MainActivity2.class);
        }
    };

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_empty);
        init();
    }

    private void init() {
        Handler mHandler = CommonUtil.getMainHandler();
        mHandler.removeCallbacks(task);
        mHandler.postDelayed(task, 1000);


    }
    public void openActivity(Class clazz) {
        Intent intent = new Intent(this, clazz);
        startActivity(intent);
        finish();
    }

}
